package com.niuxiaofa.newlaw.View;

import android.content.Context;
import android.util.AttributeSet;

import com.liji.imagezoom.util.ImageZoom;
import com.niuxiaofa.newlaw.Tools.GlideUtils;
import com.niuxiaofa.newlaw.Tools.UIUtils;
import com.niuxiaofa.newlaw.adapter.NineGridLayout;

import java.util.List;

/**
 * 描述：
 * 作者：HMY
 * 时间：2016/5/12
 */
public class NineGridTestLayout extends NineGridLayout {

    protected static final int MAX_W_H_RATIO = 3;

    public NineGridTestLayout(Context context) {
        super(context);
    }

    public NineGridTestLayout(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    protected boolean displayOneImage(final RatioImageView imageView, String url, final int parentWidth) {

        GlideUtils.loadNoRoundedImage2(getContext(),url,imageView);

        setOneImageLayoutParams(imageView, parentWidth, UIUtils.dp2px(getContext(),200));

        return false;
    }

    @Override
    protected void displayImage(RatioImageView imageView, String url) {
        GlideUtils.loadNoRoundedImage(getContext(),url,imageView);
    }

    @Override
    protected void onClickImage(int i, String url, List<String> urlList) {
//        Toast.makeText(mContext, "点击了图片" + url, Toast.LENGTH_SHORT).show();
        ImageZoom.show(UIUtils.getActivity(), 2, urlList);
    }
}
